package com.aaa.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@ApiModel("用户信息")
@Data
public class User {

    private Long id;

    @ApiModelProperty("用户名")
    private String username;

    @JsonIgnore // 不参与JSON序列化, 不返回给前端
    private String password;

    private String nickname;

    private String phoneNum;

    private String email;

    private Byte gender;

    @JsonIgnore // 不参与JSON序列化, 不返回给前端
    private String salt;

    @JsonInclude(JsonInclude.Include.ALWAYS)    // 就算值为空, 也进行序列化, 返回给前端（因为配置文件中, 配置了值为空, 就不进行序列化）
    private String avatarUrl;

    private Integer articleCount;

    private Byte isAdmin;

    private String remark;

    private Byte state;

    private Byte deleteState;

    private Date createTime;

    private Date updateTime;

    // 关注状态
    private Byte subscribeState;

    // 关注数量
    private Long subscribeCount;

    // 粉丝数量
    private Long fanCount;
}